<#include "/default/utils/ui.ftl"/>
<@layout "发布">
<style>
    .img-upload {
        position: relative;
        display: inline-block;
        margin-left: 0;
        width: 90px;
        height: 90px
    }
    .img-upload input[type=file] {
        position: absolute;
        right: 0;
        top: 0;
        opacity: 0;
        width: 90px;
        height: 90px;
        cursor: pointer
    }
    .img-upload img {
        width: 90px;
        height: 90px
    }
    .up_item {
        position: relative;
        display: inline-block;
        margin-right: 20px;
        margin-bottom: 20px
    }

    .up_item i {
        position: absolute;
        z-index: 999;
        cursor: pointer
    }

    .up_item i.enlarge_icon {
        width: 18px;
        height: 18px;
        bottom: 5px;
        right: 3px;
        background: url(/static/default/images/enlarge.png) no-repeat
    }

    .up_item i.up_del_icon {
        width: 20px;
        height: 20px;
        top: -6px;
        right: -8px;
        background: url(/static/default/images/up_del.png) no-repeat
    }
</style>
<div class="panel panel-default">
	<div class="panel-heading">
		<i class="icon icon-pencil"></i> 发布
	</div>
	<div class="panel-body">
		<div id="message"></div>
		<form class="form-horizontal" action="${base}/post/submit" method="post" enctype="multipart/form-data">
			<input name="pictureList" id="pictureList" type="hidden" value="">
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">标题</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" name="title" maxlength="128" data-required >
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right">发布到</label>
                <div class="col-sm-3">
                    <select class="form-control" name="channelId">
						<#list channels as row>
                        <option value="${row.id}">${row.name}</option>
						</#list>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right">是否公开</label>
                <div class="col-sm-3">
                    <label class="radio-inline">
                        <input type="radio" name="openInfo" id="openInfoO" value="1"> 公开
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="openInfo" id="openInfoT" value="2"> 不公开
                    </label>
                </div>
            </div>
            <div class="form-group" style="text-align: center;">
                <div class="col-sm-2"></div>
                <div class="col-sm-4">
                    <button type="button" class="btn btn-danger">公开:全部用户可以查看,不公开:只有本小区人员可以查看</button>
                </div>
                <div class="col-sm-2">
                    <a href="/user/profile" class="btn btn-primary btn-sm signup">完善信息</a>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right">图片上传</label>
                <div id="eventList" class="col-sm-10">
                    <a id="container" class="img-upload" href="#">
                        <img src="/static/default/images/icon-upload-img.png" alt="">
                        <input type="file" id="pickfiles" name="" value="选择文件上传"><!-- 上传节点必须有id js要用 -->
                    </a>
                </div>
			</div>
            <div class="form-group">
				<label for="desc" class="col-sm-2 control-label no-padding-right">内容</label>
				<input type="hidden" name="editor" value="${site_editor}"/>
				<div class="col-sm-8">
					<#include "/default/channel/editor/ueditor.ftl"/>
				</div>
			</div>
			<#--<div class="form-group">-->
				<#--<label class="col-sm-2 control-label no-padding-right">标签</label>-->
				<#--<div class="col-sm-8">-->
					<#--<input type="hidden" name="tags" id="fieldTags">-->
					<#--<ul id="tags"></ul>-->
					<#--<p class="help-block" style="font-size: 12px;">添加相关标签，用逗号或空格分隔 (最多4个).</p>-->
				<#--</div>-->
			<#--</div>-->
			<div class="row">
				<div class="form-group">
					<div class="text-center">
						<button type="submit" class="btn btn-primary">提交</button>
					</div>
				</div>
			</div>
		</form>
		<!-- /form-actions -->
	</div>
</div>
<script type="text/javascript" src="/static/default/js/plupload.full.min.js"></script>
<script type="text/javascript" src="/static/default/js/qiniu.min.js"></script>
<script src="/static/default/wx/js/post.js"></script>
<script type="text/javascript">
seajs.use('post', function (post) {
	post.init();
});
$(function(){
    //图片上传加载js
    loadInitUpload();
});
</script>
</@layout>
